package com.yc.service.email;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * @author zwei
 * @create 2024-08-25 14:20
 */
@Service
public class EmailStrategyFactory {
    private final Map<String, EmailStrategy> strategyMap;

    @Autowired
    public EmailStrategyFactory(Map<String, EmailStrategy> strategyMap) {
        this.strategyMap = strategyMap;
    }

    public EmailStrategy getStrategy(String opType) {
        return strategyMap.get(opType);
    }
}
